package com.zw.mes.module.assemble.service;

import com.zw.mes.common.JsonResult;
import com.zw.mes.module.assemble.mapper.TransSelMapper;
import com.zw.mes.module.assemble.model.TestModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Description: 电子转序单查询 业务
 * @Author: China.wsg
 * @Date: 2021/04/28 10:26
 */
@Service
@SuppressWarnings("all")
public class TransSelService {

    @Autowired
    private TransSelMapper transSelMapper;

    /**
     * 按条件查询
     *
     * @param dept 条件
     * @return List
     */
    public List<TestModel> findTransByCondition(TestModel testModel) {
        return transSelMapper.findTransByCondition(testModel);
    }

    /**
     * 电子转序单 数据
     *
     * @param id
     * @return
     */
    public JsonResult loadTransOrderData(Integer id) {
        JsonResult jsonResult = new JsonResult();
        jsonResult.setType(JsonResult.ResultType.SUCCESS);
        Map<String, Object> data = new HashMap<>();
        TestModel transOrderDataModel = transSelMapper.loadTransOrderDataById(id);
        jsonResult.setData(transOrderDataModel);
        return jsonResult;
    }


}
